package com.yunhe.transfer.client;

import com.yunhe.transfer.client.fallback.MeasHistoryFallbackFactory;
import com.yunhe.common.model.DomainList;
import com.yunhe.common.model.data.Measurement;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "yh-meas-history", fallbackFactory = MeasHistoryFallbackFactory.class)
@RequestMapping(value = "/measurements")
public interface MeasHistoryClient {

    @RequestMapping(value = "/batch", method = RequestMethod.POST)
    void save(@RequestBody DomainList<Measurement> domainList, @RequestParam("frequency") String frequency);
}
